function fillPage() {
    let $a = play_$breadcrumbs.find("a");
    $a.get(0).href=FilmUrl+common_index;
    $a.get(1).href=FilmUrl+common_review+"?type="+play_type_byUrl;
    $a.get(1).innerHTML=play_type_byUrl;
    $a.get(2).href=FilmUrl+common_about+"?title="+play_title_byUrl+"&type="+play_type_byUrl;
    $a.get(2).innerHTML=play_title_byUrl;
    play_$breadcrumbs.find("span").get(0).innerHTML=play_video_byUrl;
}
function play_function_setVideo(video) {
  let $video = play_$video.get(0);
  $video.src=FilmUrl+"film\\"+play_type_byUrl+"\\"+play_title_byUrl+"\\"+video;
  $video.title=video.substring(0,video.lastIndexOf("."));
    play_$firstTitle.html(play_title_byUrl+" | "+video);
    play_$breadcrumbs.find("span").get(0).innerHTML=video;
}
function play_function_clickVideo(videos) {
        play_$video.parent().get(0).rowSpan=videos.length+1;
        for(let i=0;i<videos.length;i++){
            let $tr="<tr><td style='text-align: center'><input  name='"+videos[i]+"' type=\"button\" value=\"第"+(i+1)+"集\"/></td></tr>";
            play_$table.append($tr);
        }
        play_$table.find("input[name='"+play_video_byUrl+"']").attr({style:"background-color: greenyellow"});

        play_$table.find("input[type='button']").click(function (){
            let not = play_$table.find("input[type='button']").not($(this));
            for(let i=0;i<not.length;i++){
                not.get(i).style.backgroundColor="";
            }
            this.style.backgroundColor="greenyellow";
            let video=this.name;
            play_function_setVideo(video);
            play_function_clickVideoAddRecord(video);
            play_function_jumpToProgressBar(video);
        })
}
function play_function_clickVideoAddRecord(video) {
    $.post(
        FilmUrl+common_playName+"/clickVideoAddRecord",
        {"title":play_title_byUrl,
            "type":play_type_byUrl,
            "video":FilmUrl+"film\\"+play_type_byUrl+"\\"+play_title_byUrl+"\\"+video,
           },
        "json"
    )
}

/**
 * 用cookies存储进度条
 */
function play_function_recordVideoProgressBar() {
    let currentTime = play_$video.get(0).currentTime.toFixed(0);
    let src = play_$video.get(0).src;

    src=src.substring(src.lastIndexOf("/")+1);

    let video={"UserName":Cookies.get("UserName"),"title":play_title_byUrl,"type":play_type_byUrl,"video":src};
    let s = JSON.stringify(video);
    Cookies.remove(s);
    Cookies.set(s,currentTime,{expires: 7});  //设置过期时间为 7 天
}

/**
 * 跳到指定播放点
 */
function play_function_jumpToProgressBar(video) {
    if(Cookies.get("UserName")===undefined){
        return;
    }

    let vi={"UserName":Cookies.get("UserName"),"title":play_title_byUrl,"type":play_type_byUrl,"video":video};
    let s = JSON.stringify(vi);
    let newVar = Cookies.get(s);

    if(newVar!==undefined){
        play_$video.get(0).currentTime=newVar;
    }
}